<template>
    <div>
        <p>我是孙子组件</p>
        <p>getnum1:{{ getnum1 }}</p>
    </div>
</template>

<script setup>
import { inject } from 'vue';

// 语法: 注入依赖
// const 变量= inject('key')
const getnum1 = inject('num1')
console.log('getnum1', getnum1);

</script>
<style scoped></style>